<!-- 动态估分 -->
<template>
	<view class="trendsScore">
		<!-- 顶部图片说明 -->
		<view class="contents">
			<view class="searchs">
				<view class="tabs flex font14">
					<view v-for="(item,index) in tabOoption" :key="index" class="tab-item"
						:class="index == tabIndex?'choose-tab font16 bold':''" @click="handleTab(item,index)">
						{{item.name}} <text>{{item.nums}}</text>
					</view>
					<view class="choose-line"
						:style="tabIndex==0?'left: 94rpx':tabIndex==1?'left: 324rpx':tabIndex==2?'left: 556rpx':''"></view>
				</view>

				<view class="search-select-major flex alignCenter" @click="handlePopup(1)">
					<view class="flex alignCenter">
						<uni-icons type="search" size="18" color="#ccc" style="margin:0 10rpx;transform: rotate(90deg)"></uni-icons>
						<view class="font14" :class="chooseArr[1].chooseData?'font14 select-item':''">
							{{chooseArr[2].chooseData.scrollTitle || chooseArr[1].chooseData.scrollTitle || '学科分类'}} </view>
					</view>
					<uni-icons type="bottom" size="14" :color="chooseArr[1].chooseData?'#F7DD5E':'#000'"
						style="margin-right: 20rpx;" @click="handlePopup(1)"></uni-icons>
				</view>

				<!-- 估分 -->
				<view class="search-select-num flex alignCenter" @click="handlePopup(5)">
					<view class="flex alignCenter">
						<image src="/static/image/toolbox/edit.png" mode="widthFix"></image>
						<view class="font14" :class="sourceStr?'font14 select-item':''">{{sourceStr || '估分最低分~最高分' }}
							<text class="font12 colorccc" v-if="!sourceStr">（选填）</text>
						</view>
					</view>
					<uni-icons v-if="sourceStr" type="closeempty" size="14" style="margin-right: 20rpx;"
						@click="handleSourceDel"></uni-icons>
				</view>

				<view class="other-box flex alignCenter">
					<view class="search-select flex alignCenter" @click="handlePopup(6)">
						<view class="font12 bold" :class="arreaName?'font14 select-item':''">{{arreaName || '省份'}} </view>
						<uni-icons type="bottom" size="14" :color="arreaName?'#F7DD5E':'#000'" style="margin-left: 10rpx;"
							@click="handlePopup(6)"></uni-icons>
					</view>

					<view class="search-select flex alignCenter" @click="handlePopup(2)">
						<view class="font12 bold" :class="studyName?'font14 select-item':''">{{studyName || '学习形式'}} </view>
						<uni-icons type="bottom" size="14" :color="studyName?'#F7DD5E':'#000'" style="margin-left: 10rpx;"
							@click="handlePopup(2)"></uni-icons>
					</view>
					<view class="search-select flex alignCenter" @click="handlePopup(3)">
						<view class="font12 bold" :class="classFyName?'font14 select-item':''">{{classFyName||'学校类型'}}</view>
						<uni-icons type="bottom" size="14" :color="classFyName?'#F7DD5E':'#000'" style="margin-left: 10rpx;"
							@click="handlePopup(3)"></uni-icons>
					</view>
					<view class="search-select font12 bold flex alignCenter" @click="handlePopup(4)">
						更多筛选
						<uni-icons type="list" size="14" color="#000" style="margin-left: 4rpx;"
							@click="handlePopup(4)"></uni-icons>
					</view>
				</view>
			</view>

			<view class="lists">
				<view class="content-item" v-for="(item,index) of schoolList" :key="item.id">
					<view class="items flex alignCenter">
						<view class="classFy font12" :style="`background: `+colorList[item.schoolClassify]">{{item.schoolClassify}}
						</view>
						<!-- 左侧图片 -->
						<view class="left">
							<image :src="item.logo" mode="widthFix"></image>
							<view class="area-name font12 flex">
								<uni-icons class="erae-icon" type="location-filled" size="14" color="#797979"></uni-icons>
								{{item.provinceName}}
							</view>
						</view>

						<!-- 右侧数据 -->
						<view class="right">
							<view class="title font12 hiddenOneline flex alignCenter">
								<view class="hot-num font14 bold flex alignCenter">
									<image src="@/static/image/index/hot.png" mode="widthFix"></image>{{item.hot||0}}
								</view>
								<text class="font16 bold schoolName">{{item.schoolName}}</text>
								<text class="font12 bold schoolName colorccc">{{item.collegeName ||''}}</text>
							</view>

							<view class="normal-title"><text class="font12 bold">{{ item.majorCode + '' + item.majorName }}</text>
								<text class="font12 colorccc">{{item.studyTypeDesc || ''}}</text></view>
							<view class="type flex flexWrap">
								<view class="name font12" v-for="val of item.schoolType.split(',')">{{val}}</view>
							</view>

						</view>
					</view>
					<view class="btns font14 flex">
						<view class="btn1 flex alignCenter font12" @click.stop="handleClick(item)">
							<image src="https://aihelp.oss-cn-hangzhou.aliyuncs.com/kwkd/resources/front/homePage/icon3.png"
								mode="widthFix"></image> 估分详情
						</view>
						<view class="btn2 flex alignCenter font12" @click.stop="handleSchool(item)">
							<image src="https://aihelp.oss-cn-hangzhou.aliyuncs.com/kwkd/resources/front/homePage/icon4.png"
								mode="widthFix"></image>大学详情
						</view>
						<view class="btn3 flex alignCenter font12" @click.stop="handleLibrary(item)">
							<image src="https://aihelp.oss-cn-hangzhou.aliyuncs.com/kwkd/resources/front/homePage/icon6.png"
								mode="widthFix"></image>加入对比库
						</view>
					</view>
				</view>

			</view>
		</view>
		<view class="no-data" v-if="schoolList.length<=0">
			<image src="https://image.alhelp.net/uploads/20231104/8d4f88d27dfddc10b427fbe997780eaf.png" mode="widthFix">
			</image>
			<view v-if="!chooseArr[0].chooseData" class="font14 color999">选择学科分类以查询数据</view>
			<view v-else class="font14 color999">暂无数据</view>
		</view>
		<view v-else-if="schoolList.length>=total" class="font12 color999 noMore-data"> - 没有更多数据了 - </view>


		<!-- 学科分类 -->
		<view class="pickerLayer" v-if="showPicker">
			<view class="layerMain">
				<view class="layerTitle flex alignCenter">
					<view class="cancel font14 colorccc" @click="closeClick">取消</view>
					<view class="title">选择学科分类</view>
					<view class="sure font14 colorMain" @click="handleSureMajor">确定</view>
				</view>

				<!-- 	<view class="layerTitle">
					选择学科分类
					<uni-icons class="layerClose" type="closeempty" size="20" @click="closeClick"></uni-icons>
				</view> -->
				<scroll-view scroll-x="true">
					<view class="flex alignCenter font14 chooseBox">
						<view v-if="layerActiveChoose>=index"
							:class="layerActiveChoose==index?'commonChoose activeLayerStyle hiddenOneline':'commonChoose hiddenOneline'"
							v-for="(item,index) in chooseArr" :key="index" @click="clickLayerTitle(index)">
							{{item.chooseData?item.chooseData.scrollTitle:'请选择'}}
						</view>
					</view>
				</scroll-view>
				<!-- 请求展示的·数据 -->
				<view class="dataBox">
					<scroll-view scroll-y="true" class="font14 dataScroll">
						<view :class="chooseArr[layerActiveChoose].chooseData.id==item.id?'scrollItem colorMain':'scrollItem'"
							v-for="(item,index) in scrollData" :key="index" @click="clickScrollItem(item)">
							{{item.scrollTitle}}
							<uni-icons v-if="chooseArr[layerActiveChoose].chooseData.id==item.id" class="activeIcon"
								type="checkmarkempty" size="16"></uni-icons>
						</view>
					</scroll-view>
				</view>
			</view>
		</view>
		<u-popup v-model="searchPopup" mode="bottom" :mask-close-able="false">
			<view class="popup-box">
				<view class="flex btns">
					<view class="font14 cancel" @click="handleCancel">取消</view>
					<view class="font14 sure" @click="handleSure">确认</view>
				</view>
				<view class="search-contents" :class="popType == 4?'search-contents-more':''">
					<!-- 学习形式 -->
					<view v-if="popType==2">
						<view v-for="(item,index) in studyOptions" :key="index" :class="index==studyIndex?'chooseItem':''"
							@click="studyIndex = index">{{item.name}}</view>
					</view>
					<!-- 学校类型 -->
					<view v-if="popType == 3">
						<view v-for="(item,index) in schoolClassifyOptions" :class="index==classFyIndex?'chooseItem':''"
							:key="index" @click="classFyIndex = index">{{item.dictLabel}}</view>
					</view>
					<!-- 省份 -->
					<view v-if="popType == 6">
						<view v-for="(item,index) in options" :class="index==optionsIndex?'chooseItem':''" :key="index"
							@click="optionsIndex = index">{{item.fullName}}</view>
					</view>
					<!-- 更多 -->
					<view class="more-search" v-if="popType == 4">
						<view>
							<view class="title font14 bold">学校层次</view>
							<view class="flex flexWrap">
								<view class="tab-item font12" v-for="(item,index) in options1" :key="index"
									:class="index==options1Index?'chooseItem':''" @click="options1Index = index">{{item.dictLabel}}</view>
							</view>
						</view>
						<view>
							<view class="title font14 bold">学科星级</view>
							<view class="flex flexWrap">
								<view class="tab-item font12" v-for="(item,index) in subjectStarOptions"
									:class="index==startIndex?'chooseItem':''" @click="startIndex = index" :key="index">
									{{item.dictLabel}}</view>
							</view>
						</view>
						<view>
							<view class="title font14 bold">一级学科星级</view>
							<view class="flex flexWrap">
								<view class="tab-item font12" v-for="(item,index) in subjectStarOptions1"
									:class="index==startIndex1?'chooseItem':''" @click="startIndex1 = index" :key="index">
									{{item.dictLabel}}</view>
							</view>
						</view>
						<view>
							<view class="title font14 bold">专业星级</view>
							<view class="flex flexWrap">
								<view class="tab-item font12" v-for="(item,index) in subjectStarOptions2"
									:class="index==startIndex2?'chooseItem':''" @click="startIndex2 = index" :key="index">
									{{item.dictLabel}}</view>
							</view>
						</view>

						<view>
							<view class="title font14 bold">数学偏好(非必选)</view>
							<view class="flex flexWrap">
								<uni-data-checkbox multiple v-model="examList1"
									:localdata="otherOptions.mathOption"></uni-data-checkbox>
							</view>
						</view>
						<view>
							<view class="title font14 bold">英语偏好(非必选)</view>
							<view class="flex flexWrap">
								<uni-data-checkbox multiple v-model="examList2"
									:localdata="otherOptions.englishOption"></uni-data-checkbox>
							</view>
						</view>
					</view>
					<!-- 估分 -->
					<view class="score-search flex alignCenter" v-if="popType==5">
						<view class="flex alignCenter font12"><text>最低分：</text> <input type="number" v-model="sourceArr[0]" />
						</view>
						~
						<view class="flex alignCenter font12"><text>最高分：</text> <input type="number" v-model="sourceArr[1]" />
						</view>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	import {
		getProvince,
		getSubject,
		getMajorBySubject,
		addMyContrast
	} from "@/api/index.js"

	import {
		guess,
		selectList
	} from "@/api/toolbox.js"
	export default {
		data() {
			return {
				searchPopup:false,
				tabIndex: 0,
				tabOoption: [{
						id: 1,
						name: '保底',
						nums: 0,
						colors: '#1AC5A6'
					},
					{
						id: 2,
						name: '努力',
						nums: 0,
						colors: '#AFABFF'
					},
					{
						id: 3,
						name: '挑战',
						nums: 0,
						colors: '#FF594C'
					},
				],
				popType: 1,
				studyName: '',
				arreaName: '',
				option1Name: '',
				classFyName: '',
				studyIndex: 0,
				startIndex: 0, //学科星级选择
				startIndex1: 0, //一级学科星级选择
				startIndex2: 0, //专业星级选择
				optionsIndex: 0, //省份选择
				options1Index: 0, //学校层次选择
				classFyIndex: 0, //学校类型选择
				examList1: [],
				examList2: [],
				showPicker: false,
				scrollData: [], //学科门类和一级学科
				layerActiveChoose: 0,
				searchType: 'major',
				isClose: false, //是否在弹出框选择了x
				chooseArr: [{
					chooseData: ''
				}, {
					chooseData: ''
				}, {
					chooseData: ''
				}],
				studyOptions: [{
						id: '',
						name: '全部'
					},
					{
						id: '1',
						name: '全日制'
					},
					{
						id: '2',
						name: '非全日制'
					},
				],
				otherOptions: {
					mathOption: [{
						text: '不考数学',
						value: 'false'
					}, {
						text: '数一',
						value: '数学(一)'
					}, {
						text: '数二',
						value: '数学(二)'
					}, {
						text: '数三',
						value: '数学(三)'
					}],
					englishOption: [{
						text: '英一',
						value: '英语(一)'
					}, {
						text: '英二',
						value: '英语(二)'
					}, {
						text: '日语',
						value: '日语'
					}, {
						text: '俄语',
						value: '俄语'
					}, {
						text: '德语',
						value: '德语'
					}, {
						text: '梵文',
						value: '梵文'
					}]
				},
				subjectStarOptions: [], //学科星级
				subjectStarOptions1: [], //一级学科星级
				subjectStarOptions2: [], //专业星级
				options: [], //省份
				options1: [], //学校层次
				schoolClassifyOptions: [], //学校类型
				total: 0,
				sourceArr: [],
				sourceStr: '',
				searchParam: {
					isDynamicScore: 1, //是否动态估分，0否，1是
					areaId: "",
					exam: "",
					examCode: "",
					examList: [],
					majorStar: "",
					pageNum: 1,
					pageSize: 10,
					passScoreSection: [],
					schoolClassify: "",
					schoolCodeList: null,
					schoolType: "",
					studyType: "",
					subjectCode: "",
					subjectOneCode: "",
					majorCode: "",
					subjectOneStar: "",
					subjectStar: "",
					guessHighScorer: "", //最高分
					guessLowScore: "", //最低分
					year: new Date().getFullYear(),
					level: 0, //等级 0、保底，1、努力，2、挑战
					isKwkd: true
				},
				direction: '',
				colorList: {
					'综合': 'rgba(250, 205, 145, 0.6)',
					'理工': 'rgba(2, 167, 240, 0.6)',
					'财经': 'rgba(194, 128, 255, 0.6)',
					'医药': 'rgba(236, 128, 141, 0.6)',
					'民族': 'rgba(25, 204, 165, 0.6)',
					'农林': 'rgba(168,186,4,0.6)',
					'师范': 'rgba(8,164,54,0.62)',
					'体育': 'rgba(24,47,198,0.62)',
					'文法': 'rgba(192,23,118,0.62)',
					'艺术': 'rgba(20,97,119,0.62)'
				},
				schoolList: [],
			}
		},
		watch: {
			showPicker(n, o) {
				if (!n && !this.isClose) {
					this.searchParam.subjectCode = this.chooseArr[0].chooseData.subjectCode
					this.searchParam.subjectOneCode = this.chooseArr[1].chooseData.subjectCode
					this.searchParam.majorCode = this.chooseArr[2].chooseData.majorCode
					this.getData()
				}
			}
		},
		onShow() {
			// this.getData();
			// uni.showModal({
			// 	content: '请选择专业'
			// })
			this.getOptions();
			this.getSubjectList();
		},
		methods: {
			handleTab(item, index) {
				this.tabIndex = index;
				this.searchParam.level = index;
				this.handleSearch();
			},
			getOptions() {
				// 获取省份
				getProvince().then((res) => {
					this.options = res.data;
					this.options.unshift({
						fullName: '全部',
						id: ''
					});
				});
				// 获取学校层次
				selectList('school_type').then((res) => {
					this.options1 = res.rows;
					this.options1.unshift({
						dictLabel: '全部',
						dictValue: ''
					});
				})
				//获取学科星级
				selectList('subject_star').then((res) => {
					this.subjectStarOptions = res.rows;
					this.subjectStarOptions.unshift({
						dictLabel: '全部',
						dictValue: ''
					});
				});
				//获取一级学科星级
				selectList('subject_one_star').then((res) => {
					this.subjectStarOptions1 = res.rows;
					this.subjectStarOptions1.unshift({
						dictLabel: '全部',
						dictValue: ''
					});
				});
				//获取专业星级
				selectList('major_star').then((res) => {
					this.subjectStarOptions2 = res.rows;
					this.subjectStarOptions2.unshift({
						dictLabel: '全部',
						dictValue: ''
					});
				});


				//获取学校类型
				selectList('school_classify').then((res) => {
					this.schoolClassifyOptions = res.rows;
					this.schoolClassifyOptions.unshift({
						dictLabel: '全部',
						dictValue: ''
					});
				});
			},

			// 获取学科门类
			getSubjectList(type) {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				let param = {
					pageNum: 1,
					pageSize: 99999,
					type: type,
					year: new Date().getFullYear(),
				}
				if (type > 0) {
					param.subjectCode = this.chooseArr[0].chooseData.subjectCode;
				}
				getSubject(param).then((res) => {
					uni.hideLoading()
					if (res.code == 100000) {
						res.data.rows.forEach((item) => {
							item.scrollTitle = `(${item.subjectCode})${item.title}`
						})
						this.scrollData = res.data.rows
					}
				}).catch((err) => {
					uni.hideLoading()
				})
			},
			// 根据学科门类获取专业
			getMajorFromSubject() {
				let param = {
					year: new Date().getFullYear(),
					subjectOneCode: this.chooseArr[1].chooseData.subjectCode
				}
				getMajorBySubject(param).then((res) => {
					if (res.code == 100000) {
						res.data.forEach((item) => {
							item.scrollTitle = `(${item.majorCode})${item.title}`
						})
						this.scrollData = res.data;
						//当查询专业数据为空的时候，关闭弹窗，设置layerActiveChoose为0
						if (res.data.length <= 0) {
							this.layerActiveChoose = 1
							this.showPicker = false;
						}
					}
				})
			},
			// 蒙层的头部模块的点击事件
			clickLayerTitle(idx) {
				this.layerActiveChoose = idx;
				if (idx == 0) {
					this.chooseArr[1].chooseData = [];
					this.chooseArr[2].chooseData = [];
				}
				if (idx == 1) {
					this.chooseArr[2].chooseData = [];
				}
				this.dealSearchDiffToApi('scrollTitle')
			},
			// scroll的选择点击事件
			clickScrollItem(item) {
				this.chooseArr[this.layerActiveChoose].chooseData = item
				this.chooseArr.forEach((val, index) => {
					if (index > this.layerActiveChoose) {
						val.chooseData = ''
					}
				})
				if (this.layerActiveChoose >= 2) {
					this.layerActiveChoose = 2
					this.showPicker = false;
					return
				}
				this.dealSearchDiffToApi('scrollItem')
				this.layerActiveChoose++
			},
			// 根据搜索条件选择调用相应的api的处理方法
			dealSearchDiffToApi(clickModule) {
				if (clickModule == 'scrollItem') {
					if (this.searchType == 'major') {
						if (this.layerActiveChoose == 0) {
							this.getSubjectList(1)
						} else if (this.layerActiveChoose == 1) {
							this.getMajorFromSubject()
						}
					}
					return
				} else if (clickModule == 'scrollTitle') {
					if (this.searchType == 'major') {
						if (this.layerActiveChoose == 0) {
							this.getSubjectList(0)
						} else if (this.layerActiveChoose == 1) {
							this.getSubjectList(1)
						} else if (this.layerActiveChoose == 2) {
							this.getMajorFromSubject()
						}
					}
				}
			},
			// 确认选择
			handleSureMajor() {
				this.showPicker = false;
			},
			// 关闭选择弹框
			closeClick() {
				this.showPicker = false
			},

			/**
			 * @param {Object} type 1、学科分类，2、学习形式，3、学校类型，4、更多筛选，5、估分
			 */
			handlePopup(type) {
				this.popType = type;
				if (type == 1) {
					this.dealSearchDiffToApi('scrollTitle');
					this.showPicker = true;
					return
				}
				this.searchPopup = true;
			},

			// 搜索弹框确认按钮
			handleSure() {
				// 学习形式
				if (this.popType == 2) {
					this.studyName = this.studyOptions[this.studyIndex].name;
					if (this.studyIndex == 0) {
						this.studyName = '';
					}
					this.searchParam.studyType = this.studyOptions[this.studyIndex].id
				}
				// 学习类型
				if (this.popType == 3) {
					this.classFyName = this.schoolClassifyOptions[this.classFyIndex].dictLabel;
					if (this.classFyIndex == 0) {
						this.classFyName = '';
					}
					this.searchParam.schoolClassify = this.schoolClassifyOptions[this.classFyIndex].dictValue
				}
				// 省份
				if (this.popType == 6) {
					this.searchParam.areaId = this.options[this.optionsIndex].id; //省份
					this.arreaName = this.options[this.optionsIndex].fullName == '全部' ? '' : this.options[this.optionsIndex]
						.fullName;
				}
				// 估分
				if (this.popType == 5) {
					this.searchParam.guessLowScore = this.sourceArr[0];
					this.searchParam.guessHighScorer = this.sourceArr[1];
					this.sourceStr = (this.sourceArr[0] && this.sourceArr[1]) ? (this.sourceArr[0] + '~' + this.sourceArr[1]) : (
						this.sourceArr[0] || this.sourceArr[1]);
				}
				// 更多
				if (this.popType == 4) {
					this.searchParam.subjectStar = this.subjectStarOptions[this.startIndex].dictValue; //学科星级
					this.searchParam.subjectOneStar = this.subjectStarOptions1[this.startIndex1].dictValue; //一级学科星级
					this.searchParam.majorStar = this.subjectStarOptions2[this.startIndex2].dictValue; //专业星级
					this.searchParam.schoolType = this.options1[this.options1Index].dictValue; //层次
					this.searchParam.examList = this.examList1.concat(this.examList2); //数学、英语偏好
				}
				this.searchPopup = false;
				this.handleSearch();
			},

			// 搜索弹框取消按钮
			handleCancel() {
				if (this.popType == 5) {
					this.sourceArr = [this.searchParam.guessLowScore, this.searchParam.guessHighScorer]; //估分
				}
				this.searchPopup = false;
			},
			// 删除估分
			handleSourceDel() {
				this.searchParam.guessLowScore = '';
				this.sourceArr = [];
				this.searchParam.guessHighScorer = '';
				this.sourceStr = '';
				this.handleSearch();
			},

			handleSearch() {
				if (!this.chooseArr[1].chooseData) {
					return
				}
				this.searchParam.pageNum = 1;
				this.total = 0;
				// this.schoolList = [];
				this.getData();
			},

			handleClick(item) {
				item.guessHighScorer = this.searchParam.guessHighScorer || 0;
				item.guessLowScore = this.searchParam.guessLowScore || 0;
				uni.navigateTo({
					url: `/pages/toolbox/trendsScore/detail?items=${JSON.stringify(item)}`
				})
			},
			handleSchool(item) {
				uni.navigateTo({
					url: `/pages/toolbox/chooseMajor/school/schoolDetail?schoolCode=${item.schoolCode}&title=${item.schoolName}`
				})
			},

			getData() {
				uni.showLoading({
					title: '数据加载中'
				})
				guess(this.searchParam).then((res) => {
					console.log('res', res);
					uni.hideLoading();
					// if(res.code==100000){
					// this.schoolList = res.data.rows;
					if (this.searchParam.pageNum == 1) {
						this.schoolList = res.data;
						this.total = res.msg || 0;
						this.tabOoption[0].nums = res.mapData ? res.mapData.baodiNum : 0;
						this.tabOoption[1].nums = res.mapData ? res.mapData.nuliNum : 0;
						this.tabOoption[2].nums = res.mapData ? res.mapData.tiaozNum : 0;
						return
					}
					this.schoolList.push.apply(this.schoolList, res.data);
					// }
				}).catch(err => {
					uni.hideLoading();
				})

			},
			// 报录比
			handleB(item) {
				console.log(item);
				let items = {
					"collegeCode": item.collegeCode, //"023"
					"majorCode": item.majorCode, //"010101"
					"schoolCode": item.schoolCode, //"10001"
				}
				uni.navigateTo({
					url: `/pages/toolbox/chooseMajor/major/majorDetail?items=${JSON.stringify(items)}`
				})
			},
			// 加入对比库
			handleLibrary(item) {
				addMyContrast({
					collegeCode: item.collegeCode,
					createTime: item.createTime,
					isDel: 0,
					majorCode: item.majorCode,
					schoolCode: item.schoolCode,
					updateTime: item.updateTime,
					year: item.year,
				}).then(res => {
					console.log(res);
					if (res.code == 100000) {
						uni.showToast({
							title: '加入对比库成功',
							icon: 'none'
						})
					}
				})
			},
			//底部刷新
			onReachBottom() {
				if (this.schoolList.length >= this.total) return;
				this.searchParam.pageNum++;
				this.getData();
			}
		},
	}
</script>

<style lang="scss" scoped>
	page {
		background: #f2f2f2;
	}

	.trendsScore {
		// .top-bg{
		// 	width: 100%;
		// 	height: 280rpx;
		// 	background: rgba(247,221,94,0.8);
		// }
		padding-bottom: 20rpx;

		.contents {
			.searchs {
				// margin: -80rpx 30rpx 40rpx 30rpx;
				// height: 120rpx;
				// padding: 46rpx 0;
				// line-height: 1em;
				background: #f2f2f2;
				padding-bottom: 30rpx;
				// box-shadow: 0 0 12rpx rgba(0,0,0,.2);
				// border-radius: 20rpx;
				position: sticky;
				top: 0rpx;
				/* #ifdef H5 */
				top: 80rpx;
				/* #endif */
				z-index: 2;

				.tabs {
					text-align: center;
					justify-content: center;
					background: #fff;
					height: 104rpx;
					padding: 0 32rpx;

					.tab-item {
						margin: auto;
						flex: 1;

						text {
							margin-left: 10rpx;
						}
					}

					.choose-line {
						position: absolute;
						width: 100rpx;
						background: $colorMain;
						height: 10rpx;
						border-radius: 20rpx;
						box-shadow: 0 6px 10px rgba(0, 0, 0, .15);
						transition: left 0.5s;
						top: 88rpx;
					}
				}

				.search-select-major,
				.search-select-num {
					margin: 20rpx 32rpx;
					// height: 64rpx;
					padding: 20rpx;
					background: #fff;
					line-height: 1em;
					border-radius: 14rpx;
					border-color: rgba(242, 242, 242, 1);
					color: #333;
					justify-content: space-between;
				}

				.search-select-num {

					// justify-content: flex-start;
					image {
						width: 36rpx;
						height: 36rpx;
						margin-right: 20rpx;
					}
				}

				.select-item {
					color: #F7DD5E;
				}

				.other-box {
					// padding-top: 30rpx;
					// align-items: center;
					justify-content: space-around;

				}

				.search-select {
					color: #666666;

					// align-items: center;
					// max-width: 244rpx;
					view {
						text-align: center;
					}
				}

			}

			.lists {
				padding-top: 30rpx;

				// padding-bottom: 20rpx;
				.content-item {
					background: #ffffff;
					margin: 0 30rpx 40rpx;
					border-radius: 30rpx;
					box-shadow: 0 0 12rpx rgba(0, 0, 0, .3);
					padding-bottom: 36rpx;
					position: relative;

					.classFy {
						// position: absolute;
						margin-bottom: 8rpx;
						width: 100rpx;
						height: 52rpx;
						line-height: 52rpx;
						background: rgba(25, 204, 165, 0.6);
						border-radius: 30rpx;
						border-top-right-radius: 0px;
						border-bottom-left-radius: 0px;
						color: #FFFFFF;
						text-align: center;
						position: absolute;
						z-index: 1;
						top: 0px;
					}

					.items {
						padding-top: 30rpx;
					}

					.left {
						margin: auto 0;

						image {
							width: 160rpx;
							height: 160rpx;
							border-radius: 50%;
							margin: 0 30rpx;
							display: block;
						}

						.area-name {
							color: #7F7F7F;
							padding-top: 20rpx;
							align-items: center;
							justify-content: center;
							line-height: 1em;

							.erae-icon {
								margin: 0 2rpx
							}

							// color: #7F7F7F;
							// padding-top: 20rpx;
							// align-items: center;
							// justify-content: center;

							// image{
							// 	width: 30rpx;
							// 	height: 30rpx;
							// 	margin: 0 10rpx
							// }
						}
					}

					.right {

						// margin-left: 48rpx;
						.title {
							margin: 0rpx 10rpx 16rpx 0;
							font-style: normal;
							color: #333333;
							width: 360rpx;

							// line-height: 1em;
							.schoolName {
								margin-right: 20rpx;
							}
						}

						.normal-title {
							margin: 0 0 24rpx 0;
							line-height: 1em;

							text:last-child {
								margin-left: 20rpx;
							}
						}

						.type {
							margin-top: 10rpx;

							.name {
								color: #333;
								border: 1px solid rgba(247, 221, 94, 1);
								background: rgba(247, 221, 94, 0.1);
								border-radius: 30rpx;
								padding: 0 10rpx;
								margin: 0 10rpx 10rpx 0;
							}
						}

						.hot-num {
							color: #FF7101;
							position: absolute;
							right: 20rpx;

							// margin-top: -44rpx;
							image {
								width: 32rpx;
								height: 36rpx;
							}
						}

					}

					.btns {
						margin-top: 36rpx;
						align-items: center;
						justify-content: flex-end;
						margin-right: 30rpx;

						.btn1,
						.btn2,
						.btn3 {
							// background-color: rgba(247, 221, 94, 1);
							// width: 200rpx;
							// height: 80rpx;
							// align-items: center;
							// justify-content: center;
							// margin-right: 20rpx;
							// color: #333;
							// border-radius: 50rpx;
							width: 194rpx;
							height: 72rpx;
							align-items: center;
							justify-content: center;
							color: #333;
						}

						image {
							width: 32rpx;
							height: 32rpx;
							margin-right: 8rpx;
						}

						.btn1 {}

						.btn2 {}

						.btn3 {
							margin-right: 0px;
						}
					}
				}
			}

		}

		.no-data {
			text-align: center;
			margin-top: 120rpx;

			image {
				width: 120rpx;
				height: 120rpx;
			}
		}

		.noMore-data {
			text-align: center;
			padding-bottom: 20rpx;
		}

		.pickerLayer {
			position: fixed;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background: rgba(0, 0, 0, .15);
			z-index: 2;

			.layerMain {
				position: absolute;
				bottom: 0;
				left: 0;
				width: 100%;
				height: 1000rpx;
				padding: 30rpx 0;
				box-sizing: border-box;
				border-radius: 40rpx 40rpx 0 0;
				background: #fff;
			}

			.layerTitle {
				text-align: center;
				position: relative;
				justify-content: space-around;

				// text-align: center;
				// position: relative;
				// .layerClose{
				// 	position: absolute;
				// 	right: 30rpx;
				// 	bottom: 0;
				// }
			}

			scroll-view {
				margin: 30rpx 0 0;
			}

			.chooseBox {
				// margin: 30rpx 0 0;
				padding: 0 30rpx;
				box-sizing: border-box;
				border-bottom: 1px solid $bordercolor;
				height: 80rpx;
				line-height: 80rpx;

				.commonChoose {
					padding: 0 40rpx;
					flex-shrink: 0;
				}

				.activeLayerStyle {
					border-bottom: 2px solid $colorMain;
				}
			}

			.dataBox {
				.dataScroll {
					height: 800rpx;
					overflow-y: scroll;
				}

				.scrollItem {
					padding: 0 30rpx;
					height: 100rpx;
					line-height: 100rpx;
					box-sizing: border-box;
					position: relative;

				}

				.activeIcon {
					color: $colorMain !important;
					position: absolute;
					right: 30rpx;
					bottom: 0;
				}
			}
		}

		.popup-box {
			background: #fff;
			border-top-left-radius: 30rpx;
			border-top-right-radius: 30rpx;
			padding: 30rpx;

			// height: 1000rpx;
			.btns {
				align-items: center;
				justify-content: space-between;
				margin: 10rpx 0;

				.cancel {
					color: #AFAFAF;
				}

				.sure {
					color: #F7DD5E;
				}
			}

			.search-contents {
				text-align: center;
				line-height: 70rpx;
				overflow-x: hidden;
				height: 400rpx;
				// background: #F7DD5E;

				.chooseItem {
					background-color: rgba(253, 224, 128, 0.3);
					// background: #F7DD5E;
				}

				.more-search {
					text-align: left;

					.title {
						margin-top: 40rpx;
					}

					.tab-item {
						// width: 120rpx;
						padding: 20rpx 30rpx;
						background: rgba(175, 175, 175, 0.2);
						color: #333;
						border-radius: 50rpx;
						// border: 1px solid #333;
						height: 20rpx;
						text-align: center;
						line-height: 20rpx;
						margin: 10rpx 10rpx 10rpx 0;
					}


					.chooseItem {
						background-color: rgba(253, 224, 128, 0.3);
						border: 1px solid #F7DD5E;
					}
				}

				.score-search {
					margin-top: 80rpx;
					justify-content: space-between;

					view {
						border: 1px solid #ccc;
						border-radius: 4rpx;
						// margin-bottom: 20rpx;
						padding: 0 10rpx;
						color: #333;
					}

					input {
						text-align: left;
						width: 200rpx;
					}
				}
			}

			.search-contents-more {
				height: 900rpx;
			}

		}


	}
</style>